﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHook.Native;

namespace NHook
{
	public class Disassembler
	{
		public IEnumerable<DisasmResult> Disassemble(byte[] buffer)
		{
			int offset = 0;
			while(true)
			{
				var result = DisasmWrapper.Disasm(buffer, offset);
				if(result == null)
					yield break;
				offset += result.Bytes.Length;
				yield return result;
			}
		}
	}
}
